package xkp.lesson;

import java.io.Serializable;

public class Driver implements Serializable {
    private String name;
    private Integer age;

    private Car car;

    public Driver() {
    }

    public Driver(String name, Integer age, Car car) {
        this.name = name;
        this.age = age;
        this.car = car;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    @Override
    public String toString() {
        return "Driver{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", car=" + car +
                '}';
    }

  /*  @Override
    public Object clone() throws CloneNotSupportedException {
        Driver driver = (Driver) super.clone();
        driver.car = (Car) this.car.clone();
        return driver;
    }*/
}
